{{define "title"}}LUCI Scheduler :: {{.Job.ProjectID}} :: {{.Job.JobName}} :: {{.Inv.InvID}}{{end}}

{{define "head"}}
<style type="text/css">
.underline {
  text-decoration: underline !important;
}
.ellipsis-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
</style>
{{template "invocation-action-scripts" .}}
{{end}}

{{define "content"}}

<ol class="breadcrumb">
  <li class="breadcrumb-item"><a href="/">All projects</a></li>
  <li class="breadcrumb-item"><a href="/jobs/{{.Job.ProjectID}}">{{.Job.ProjectID}}</a></li>
  <li class="breadcrumb-item">{{template "job-id-ref" .Job}}</li>
  <li class="breadcrumb-item active">{{.Inv.InvID}}</li>
</ol>

<div class="container">
  <div class="row">
    <div class="col-sm-2"><b>Status:</b>
      {{if .Inv.ViewURL}}
        <a href="{{.Inv.ViewURL}}" target="_blank" class="underline label {{.Inv.LabelClass}}">{{.Inv.Status}}</a>
      {{else}}
        <span class="label {{.Inv.LabelClass}}">{{.Inv.Status}}</span>
      {{end}}
    </div>
    <div class="col-sm-4 ellipsis-text" title="Triggered By: {{.Inv.TriggeredBy}}">
      <b>Triggered by:</b> {{.Inv.TriggeredBy}}
    </div>
    <div class="col-sm-3"><b>Duration:</b> {{.Inv.Duration}}</div>
    <div class="col-sm-3"><b>Actions:</b>{{template "invocation-action-buttons" .Inv}}</div>
  </div>

  <div class="col-sm-12">
    <hr>
  </div>

  {{if .Inv.Revision}}
  <h4>Definition
  {{if .Inv.RevisionURL}}
    (rev <a href="{{.Inv.RevisionURL}}" target="_blank">{{.Inv.Revision}}</a>)
  {{else}}
    (rev {{.Inv.Revision}})
  {{end}}
  </h4>
  <div class="row">
    <div class="col-sm-12">
      <pre>{{.Inv.Definition}}</pre>
    </div>
  </div>
  {{end}}

  {{if .Inv.IncomingTriggers}}
  <h4>Incoming triggers</h4>
  <div class="row">
    <div class="col-sm-12">
      {{template "triggers-list" .Inv.IncomingTriggers}}
    </div>
  </div>
  {{end}}

  {{if .Inv.Properties}}
  <h4>Incoming properties</h4>
  <div class="row">
    <div class="col-sm-12">
      <pre>{{.Inv.Properties}}</pre>
    </div>
  </div>
  {{end}}

  {{if .Inv.Tags}}
  <h4>Incoming tags</h4>
  <div class="row">
    <div class="col-sm-12">
      <ul>
        {{range .Inv.Tags}}
        <li>
          <span style="font-family:monospace;">{{.}}</span>
        </li>
        {{end}}
      </ul>
    </div>
  </div>
  {{end}}

  {{if .Inv.OutgoingTriggers}}
  <h4>Outgoing triggers</h4>
  <div class="row">
    <div class="col-sm-12">
      {{template "triggers-list" .Inv.OutgoingTriggers}}
    </div>
  </div>
  {{end}}

  <h4>Debug log (UTC)</h4>
  <div class="row">
    <div class="col-sm-12">
      <pre>{{.Inv.DebugLog}}</pre>
    </div>
  </div>

</div>

{{end}}
